import { RedisOptions } from "ioredis";
import { MongoClientOptions } from "mongodb";
import { PoolConfig } from "mysql";

export interface ILyuConfig {
    name: string,
    host?: string,
    port?: number,
    redis?: RedisOptions,
}

export interface IWsConfig {
    host: string,
    port: number,
}

/**
 * 连接redis 
 */
export interface INetConfig {
    port: number,
    disconnect?: () => void;
    connect?: () => void;
}

/** 
 * 存储服务数据
 */
export interface IService {
    host: string,
    name: string,
    port: number,
    startTime?: number,
    updateTime?: number,
}

/**
 * 服务器内部消息数据结构
 */
export interface IPack {
    func: string,
    data: any,
    callBackId?: number,
}

export interface IMongoConfig extends MongoClientOptions {
    host?: string,
    port?: number,
    db?: string,
    table?: string,
}

export interface IMysqlConfig extends PoolConfig {

}